package golang

import (
	"fmt"
	"testing"
)

//单个包中代码执行顺序如下
//+  main包-->常量-->全局变量-->init函数-->main函数-->Exit

const S1 = 999 //1

var globalVarValue int = a() //2

func TestInit(t *testing.T) {
	fmt.Println("main") //4
}

func init() {
	fmt.Println("init") //3
}

func a() int {
	fmt.Println("全局变量")
	return 998
}
